package com.treasure.mall.zbqmallapi.dto;

import com.treasure.mall.biz.entity.embeddable.ReceivingInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 *
 * +---------------------------------------------------------
 * * @package: com.treasure.mall.zbqmallapi.dto
 * * @author: guomw (guomwchen@foxmail.com)
 * * @date: 2020/6/13 17:49
 * * @since: V1.0.0
 * +---------------------------------------------------------
 * 注意：本内容仅限于内部传阅，禁止外泄以及用于其他的商业目的
 * Copyright 2019-2022 com.treasure.mall.zbqmallapi.dto Inc. All rights reserved.
 */
@Data
@NoArgsConstructor
@ApiModel("微信收货地址")
public class WxAddress {
    /**
     * 城市地址
     */
    @ApiModelProperty(value = "城市名称", required = true)
    private String cityName;
    /**
     * 区域
     */
    @ApiModelProperty(value = "区域", required = true)
    private String countyName;
    /**
     * 详情地址
     */
    @ApiModelProperty(value = "详情地址", required = true)
    private String detailInfo;

    private String errMsg;
    /**
     *
     */
    @ApiModelProperty(value = "区号")
    private String nationalCode;

    /**
     * 邮政编号
     */
    @ApiModelProperty(value = "邮政编号")
    private String postalCode;
    /**
     * 省份
     */
    @ApiModelProperty(value = "省份", required = true)
    private String provinceName;
    /**
     * 收货电话
     */
    @ApiModelProperty(value = "收货电话", required = true)
    private String telNumber;
    /**
     * 收货人姓名
     */
    @ApiModelProperty(value = "收货人姓名", required = true)
    private String userName;


    public ReceivingInfo getReceivingInfo() {
        ReceivingInfo receivingInfo = new ReceivingInfo();
        receivingInfo.setCityName(this.cityName);
        receivingInfo.setProvinceName(this.provinceName);
        receivingInfo.setCountyName(this.countyName);
        receivingInfo.setDetailInfo(this.detailInfo);
        receivingInfo.setNationalCode(this.nationalCode);
        receivingInfo.setPostalCode(this.postalCode);
        receivingInfo.setTelNumber(this.telNumber);
        receivingInfo.setUserName(this.userName);
        return receivingInfo;
    }


    /**
     * 详情地址
     *
     * @return
     */
    public String full() {
        return provinceName + cityName + countyName + detailInfo;
    }
}
